package jgl.vajra.operator.part.mine.activity;

import android.view.View;

import androidx.fragment.app.Fragment;

import java.util.ArrayList;
import java.util.List;

import jgl.vajra.operator.R;
import jgl.vajra.operator.databinding.ActivityMyCarBinding;
import jgl.vajra.operator.listener.MyToolbarViewListener;
import jgl.vajra.operator.manager.FragmentManager;
import jgl.vajra.operator.manager.IntentManager;
import jgl.vajra.operator.part.mine.fragment.MyCarListFragment;
import jgl.vajra.operator.part.mine.viewModel.MyCarViewModel;
import jgl.vajra.operator.widget.mvvm.factory.CreateViewModel;
import jgl.vajra.operator.widget.mvvm.view.BaseMVVMActivity;

@CreateViewModel(MyCarViewModel.class)
public class MyCarActivity extends BaseMVVMActivity<MyCarViewModel, ActivityMyCarBinding>{
    @Override
    public int getLayoutId() {
        return R.layout.activity_my_car;
    }

    @Override
    public void initView() {
        super.initView();
        mBinding.toolbar.setMyToolbarViewListener(new MyToolbarViewListener() {
            @Override
            public void onRightTextClick() {
                super.onRightTextClick();
                //添加豪车
                IntentManager.toCarAddActivity(MyCarActivity.this);
            }
        });

        List<String> titleList = new ArrayList<>();
        titleList.add("全部豪车");

        List<Fragment> fragmentList = new ArrayList<>();
        MyCarListFragment listFragment = FragmentManager.getMyCarListFragment(5);
        fragmentList.add(listFragment);
        mBinding.tabLayout.setCustomViewTabLayoutView(this, titleList, fragmentList);

        mBinding.tabLayout.getTabLayout().setVisibility(View.GONE);

    }

}
